pa_volume_t max_volume;
GvcChannelMap *map;
char map_buff[PA_CHANNEL_MAP_SNPRINT_MAX];
+ GList *list = NULL;
pa_channel_map_snprint (map_buff, PA_CHANNEL_MAP_SNPRINT_MAX, &info->channel_map);
#if 1
GUINT_TO_POINTER (info->index));
if (stream == NULL) {
- GList *list = NULL;
- guint i;
-
map = gvc_channel_map_new_from_pa_channel_map (&info->channel_map);
stream = gvc_mixer_sink_new (control->priv->pa_context,
info->index,
map);
-
- for (i = 0; i < info->n_ports; i++) {
- GvcMixerStreamPort *port;
-
- port = g_slice_new0 (GvcMixerStreamPort);
- port->port = g_strdup (info->ports[i]->name);
- port->human_port = g_strdup (info->ports[i]->description);
- port->priority = info->ports[i]->priority;
- port->available = info->ports[i]->available != PA_PORT_AVAILABLE_NO;
-
- list = g_list_prepend (list, port);
- }
- gvc_mixer_stream_set_ports (stream, list);
-
g_object_unref (map);
is_new = TRUE;
return;
}
+ for (guint i = 0; i < info->n_ports; i++) {
+ GvcMixerStreamPort *port;
+
+ port = g_slice_new0 (GvcMixerStreamPort);
+ port->port = g_strdup (info->ports[i]->name);
+ port->human_port = g_strdup (info->ports[i]->description);
+ port->priority = info->ports[i]->priority;
+ port->available = info->ports[i]->available != PA_PORT_AVAILABLE_NO;
+
+ list = g_list_prepend (list, port);
+ }
+ gvc_mixer_stream_set_ports (stream, g_steal_pointer (&list));
+
max_volume = pa_cvolume_max (&info->volume);
gvc_mixer_stream_set_name (stream, info->name);
gvc_mixer_stream_set_card_index (stream, info->card);
GvcMixerStream *stream;
gboolean is_new;
pa_volume_t max_volume;
+ GList *list = NULL;
#if 1
g_debug ("Updating source: index=%u name='%s' description='%s'",
stream = g_hash_table_lookup (control->priv->sources,
GUINT_TO_POINTER (info->index));
if (stream == NULL) {
- GList *list = NULL;
- guint i;
GvcChannelMap *map;
map = gvc_channel_map_new_from_pa_channel_map (&info->channel_map);
stream = gvc_mixer_source_new (control->priv->pa_context,
info->index,
map);
-
- for (i = 0; i < info->n_ports; i++) {
- GvcMixerStreamPort *port;
-
- port = g_slice_new0 (GvcMixerStreamPort);
- port->port = g_strdup (info->ports[i]->name);
- port->human_port = g_strdup (info->ports[i]->description);
- port->priority = info->ports[i]->priority;
- list = g_list_prepend (list, port);
- }
- gvc_mixer_stream_set_ports (stream, list);
-
g_object_unref (map);
is_new = TRUE;
} else if (gvc_mixer_stream_is_running (stream)) {
return;
}
+ for (guint i = 0; i < info->n_ports; i++) {
+ GvcMixerStreamPort *port;
+
+ port = g_slice_new0 (GvcMixerStreamPort);
+ port->port = g_strdup (info->ports[i]->name);
+ port->human_port = g_strdup (info->ports[i]->description);
+ port->priority = info->ports[i]->priority;
+ list = g_list_prepend (list, port);
+ }
+ gvc_mixer_stream_set_ports (stream, list);
+
max_volume = pa_cvolume_max (&info->volume);
gvc_mixer_stream_set_name (stream, info->name);